package cn.xhb.mapper;

import cn.xhb.domain.Content;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ContentMapper {
    @Insert("insert into speak(userId,content) values(#{userId},#{content})")
    @Options(useGeneratedKeys = true,keyProperty = "id")
    void save(Content content);
    @Select("select * from speak where userId=#{userId}")
    List<Content> findAll(int userId);
    @Delete("delete from speak where id=#{id}")
    void del(int id);
    @Select("select * from speak")
    List<Content> find();
}
